﻿using UnityEngine;
using System.Collections.Generic;
using ALPackage;
using UnityEngine.UI;
using System;


namespace HYOK
{
    /// <summary>
    /// 带bar的wnd基类，会自动加载bar
    /// </summary>
    public abstract class _ANPGGUIBasicResBarWnd<T> : _ATALBasicUIWnd<T>, _INPGGUIBasicWndResBar where T : _ANPBasicUIWndResBarMono
    {
        protected _ANPGGUIBasicResBarWnd(EALUIWndLayer _layer)
            : base(_layer)
        {
        }

#if AL_PUERTS
        /// <summary>
        /// 增加对应puerts的处理
        /// </summary>
        protected override ALPuertsManager _puertsMgr
        {
            get { return NPPuertsMgr.instance; }
        }  
#endif

        public long getPlayerIconResId()
        {
            
            if (null == wnd)
            {
#if UNITY_EDITOR
                Debug.LogError($"界面还没初始化完就去取playrIcon的资源，注意查看");
#endif
                return 0;
            }

            return wnd.playerIconResId;
        }

        /// <summary>
        /// 获取资源barid
        /// </summary>
        /// <returns></returns>
        public long getBarResId()
        {
            if (null == wnd)
            {
#if UNITY_EDITOR
                Debug.LogError($"界面还没初始化完就去取bar的资源，注意查看");
#endif
                return 0;
            }

            return wnd.barResId;
        }
    }
}
